Flattens a 2D array into a new collection. The items are copied row by row.
Example usage:
byte[][] array = [[0, 1], [2, 3]] assert array.flatten() == [0, 1, 2, 3]
A transpose method for 2D byte arrays.
Example usage:
byte[][] bytes = [[1, 10], [2, 20]] byte[][] expected = [[1, 2], [10, 20]] def result = bytes.transpose() assert result == expected assert bytes.class.componentType == result.class.componentType